<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateEmployeesTable extends Migration
{
    public function up()
    {
        Schema::create('employees', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->string('username')->comment('用户名');
            $table->string('email')->comment('邮箱');
            $table->string('phone')->comment('手机号');
            $table->string('name')->comment('真实姓名');
            $table->string('team')->comment('班组');
            $table->string('position')->comment('职务');
            $table->bigInteger('wechat_user_id')->nullable()->comment('微信用户ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('修改时间');
            $table->timestamp('deleted_at')->nullable()->comment('删除时间');

        });

        DB::statement('alter table'. ' ' .config('database.connections.mysql.prefix', '').'employees comment "员工表"');

    }

    public function down()
    {
        Schema::dropIfExists('employees');     // 员工表
    }
}
